<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>活动报名</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css"/>
    <style>
        body{
            margin:0;
            padding:0;
            background:#F5F5F5;
            padding-top:0.5rem;
        }
        .box{
            width:100%;
            background:#fff;
            padding:0 0.75rem;
        }
        .info{
            height:2.5rem;
            line-height: 2.5rem;
            display: flex;
            justify-content: space-between;
        }
        .detail{
            color:#999;
            font-size:0.8rem;
        }
        .data{
            color:#333;
            font-size:0.8rem;
        }
        .underLine{
            border: none;
            background-size: 100% 1px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(0,#EDEBEB,#EDEBEB 50%,transparent 50%);
            background-image: -webkit-linear-gradient(90deg,#EDEBEB,#EDEBEB 50%,transparent 50%);
        }
        .topLine{
            border: none;
            background-size: 100% 1px;
            background-repeat: no-repeat;
            background-position: top;
            background-image: linear-gradient(0,#EDEBEB,#EDEBEB 50%,transparent 50%);
            background-image: -webkit-linear-gradient(90deg,#EDEBEB,#EDEBEB 50%,transparent 50%);
        }

        .container{
            width:100%;
            padding:0 0.75rem;
            height:3.5rem;
            background:#fff;
            position:fixed;
            bottom:0;
        }
        .signUp{
            width:100%;
            height:2.5rem;
            line-height: 2.5rem;
            font-size:0.8rem;
            font-weight:500;
            color:#fff;
            background:#E73C5C;
            text-align:center;
            margin:0.5rem auto;
            border-radius:0.25rem;
        }
    </style>
</head>
<body>
<div class="box underLine">
    <input type="hidden" name="id" value="{$id}">
    <div class="info underLine">
        <span class="detail">手机号</span>
        <span class="data">{$res.user_phone}</span>
    </div>
    <div class="info underLine">
        <span class="detail">姓名</span>
        <span class="data">{$res.user_username}</span>
    </div>
    <div class="info underLine">
        <span class="detail">职务</span>
        <span class="data">{$res.assortment_name}</span>
    </div>
    <div class="info ">
        <span class="detail">机构</span>
        <span class="data">{$res.mechanism_name}</span>
    </div>
</div>
<div class="container topLine" onclick="fnSubmit()" tapmode='active'>
    <div class="signUp">提交报名</div>
</div>
</body>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__layer_mobile/layer.js"></script>
<script type="text/javascript">


    // 提交报名
    function fnSubmit(){
        var activity_id = $('input[name="id"]').val();
        $.ajax({
            url:'{:url("First/postSign")}',
            data:{id:activity_id},
            type:'POST',
            dataType:'JSON',
            success:function (data) {
                console.log(data.msg);
                if(data.status==200){
                    layer.open({
                        content:"报名成功",
                        skin: 'msg'
                        ,time: 3 //2秒后自动关闭
                    });
                    location.href='{:url("First/activitydatail")}?activity_id='+activity_id;
                }else{
                    layer.open({
                        content:data.msg,
                        skin: 'msg'
                        ,time: 3 //2秒后自动关闭
                    });
                }
            }
        })
    }
</script>
</html>
